// 箭头函数
// 箭头函数不会改变this的指向

// const inc = n => n + 1;

// console.log(inc(100));

// const person = {
//     name: "tom",
//     sayHi: function () {
//         console.log(`hi, my name is ${this.name}`);//hi, my name is tom
//     }
// }

const person = {
    name: "tom",
    sayHi: () => {
        console.log(`hi, my name is ${this.name}`);//hi, my name is undefined
    }
}

person.sayHi()